package com.jingdianjichi.oss.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author:ZouChao
 * @Description:配置管理
 * @Date:Created in 16:04 2024/12/27
 * @Modified By:
 */
@Configuration
public class MinioConfig {
    /**
    * minioUrl
     */
    @Value("${minio.url}")
    private String url;
    /**
    * minio账号
     */
    @Value("${minio.accessKey}")
    private String accessKey;
    /**
    * minio密码
     */
    @Value("${minio.secretKey}")
    private String secret;

    /**
     *构造minioClient
     */
    @Bean
    public MinioClient getMinioClient() {
        return MinioClient.builder().endpoint(url).credentials(accessKey, secret).build();
    }


}
